﻿Math.factorial = function (n) {
    Math.factorial.cache = Math.factorial.cache || [1];
    return Math.factorial.cache[n] || (Math.factorial.cache[n] = n * Math.factorial(n - 1));
}

Math.rand = function (min, max) {
    return (Math.random() * (max - min + 1) + min) | 0;

}
